package cn.raven.controller;

import cn.raven.entity.Store;
import cn.raven.service.IStoreServer;
import cn.raven.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class StoreController {
    @Autowired
    private IStoreServer storeServer;

    @PostMapping("/add")
    public AjaxResult add(@RequestBody Store store){
        try {
            storeServer.add(store);
            return AjaxResult.me();
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.me().setSuccess(false).setMessage("失败了");
        }
    }

}
